package Ventanas;

import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JLabel;
import javax.swing.JPanel;


import javax.swing.ImageIcon;
import javax.swing.JButton;

import javax.swing.WindowConstants;

import Ventanas.Principal.MiOyente;
/**
 * ProyectoX TDP 2011
 * @author  Ma Gimena Ramos- LU:82716
 * @autor Brenda Dilschneider- LU: 92774
 *
 */



public class Mapas extends javax.swing.JFrame {
	private JLabel jLabel1;
	private JPanel jPanel1;
	private JButton jButton1;
	private JLabel jLabel2;
	private JButton jButton3;
	private JButton jButton2;
public static int nivel;
	/**
	* constructor
	*/
		
	public Mapas() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			{
				setTitle("Mapas del Juego");
				jPanel1 = new JPanel();
				getContentPane().add(jPanel1, BorderLayout.CENTER);
				jPanel1.setPreferredSize(new java.awt.Dimension(360, 378));
				jPanel1.setForeground(new java.awt.Color(0,0,128));
				jPanel1.setBackground(new java.awt.Color(0,0,64));
				{
					jLabel1 = new JLabel();
					jPanel1.add(jLabel1);
					jLabel1.setIcon(new ImageIcon(getClass().getClassLoader().getResource("GraficosVentana/medaion.gif")));
					jLabel1.setPreferredSize(new java.awt.Dimension(363, 216));
					jLabel1.setAlignmentX(120.0f);
					jLabel1.setForeground(new java.awt.Color(0,64,128));
					jLabel1.setBackground(new java.awt.Color(0,0,64));

				}
				{
					jButton3 = new JButton();
					jPanel1.add(jButton3);
					jButton3.setText("Nivel 1");
					jButton3.setPreferredSize(new java.awt.Dimension(106, 43));
					jButton3.setFont(new java.awt.Font("Kristen ITC",1,15));
					jButton3.addActionListener(new MiOyente());
				}
				{
					jButton2 = new JButton();
					jPanel1.add(jButton2);
					jButton2.setText("Nivel 2");
					jButton2.setPreferredSize(new java.awt.Dimension(108, 44));
					jButton2.setFont(new java.awt.Font("Kristen ITC",1,15));
					jButton2.addActionListener(new MiOyente2());
				}
				{
					jButton1 = new JButton();
					jPanel1.add(jButton1);

					jButton1.setText("Nivel 3");
					jButton1.setPreferredSize(new java.awt.Dimension(113, 46));
					jButton1.setFont(new java.awt.Font("Kristen ITC",1,15));
					jButton1.addActionListener(new MiOyente3());
				}
				{
					jLabel2 = new JLabel();
					jPanel1.add(jLabel2);
					jLabel2.setText("Seleccione el nivel a jugar");
					jLabel2.setPreferredSize(new java.awt.Dimension(289, 21));
					jLabel2.setFont(new java.awt.Font("Segoe UI",1,16));
					jLabel2.setBackground(new java.awt.Color(255,255,255));
					jLabel2.setForeground(new java.awt.Color(255,255,255));
					
				}
			}

			pack();
			this.setSize(375,350);
		} catch (Exception e) {
		   			e.printStackTrace();
		}
	}

	class MiOyente implements ActionListener{
		 public void actionPerformed(ActionEvent e)
		 {
			nivel=0;
		setVisible(false);
	    }
}
	
	class MiOyente2 implements ActionListener{
		 public void actionPerformed(ActionEvent e)
		 
		 {
			nivel=1;
			
			setNivel(obtenerNivel());
			setVisible(false);  
	    }
}
	class MiOyente3 implements ActionListener{
		 public void actionPerformed(ActionEvent e)
		 {
			    
			nivel=2;
			setVisible(false);
		    }
	    }
	

	public int obtenerNivel(){
		return nivel;
	}
	public void setNivel(int niv){
		nivel=niv;
	}
}

